home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9035 < prev    next >
Encoding:
Text File  |  1996-08-05  |  865 b   |  30 lines

  1. Path: cse.unl.edu!chijang
  2. From: chijang@cse.unl.edu (Chi-Jang Huang)
  3. Newsgroups: comp.lang.c++
  4. Subject: What does this "const" mean?
  5. Date: 28 Feb 1996 03:47:10 GMT
  6. Organization: University of Nebraska--Lincoln    
  7. Message-ID: <4h0j7u$htp@crcnis3.unl.edu>
  8. NNTP-Posting-Host: cse.unl.edu
  9. Keywords: const
  10.  
  11.  
  12. Hi,
  13.  
  14.      I have some problems regarding this program segment:
  15.  
  16.          class intset {
  17.              // ...
  18.              void start(int& i) const   { i = 0; }
  19.              int ok(int& i) const       { return i<cursize; }
  20.              int next(int& i) const     { return x[i++]; }
  21.          };
  22.  
  23.      What does "const" mean in this program segment?  What role does
  24. it play?  In what kind of situation will we use "const" like this?
  25. Any comments or suggestions are highly appreciated.  Thanks.
  26.  
  27.     --Chijang Huang.
  28. ===========================
  29.     chijang@cse.unl.edu
  30.